package com.itbaizhan.controller;

import com.itbaizhan.result.BaseResult;
import com.itbaizhan.service.BuytimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author spf
 * @date 2024/3/8
 * @time 16:13
 */
@RestController
@RequestMapping("/buytime")
public class BuytimeController {

    @Autowired
    private BuytimeService buytimeService;

    @GetMapping("/show")
    public BaseResult<Long> showTime(@RequestParam("id") String id){
        long time = buytimeService.isBuyaction(id);
        return BaseResult.ok(time);
    }

}
